package com.product.magina.wechatserver.controller;

import com.magina.common.log.LogEvent;
import com.magina.common.response.Response;
import com.product.magina.wechatserver.vo.TestPostModelVo;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

/**
 * @ClassnName :com.product.magina.wechatserver.controller.ApiExLogTestController
 * @Author： Magina.Hu
 * @Date： 2019/4/25
 * @Description： 测试api日志&异常处理&接口数据校验 记录日志->DB
 * @Version: V1.0
 * Copyright (c) 2019-2020 .All rights reserved.
 */

@RestController
@RequestMapping(value = "apiExLog")
@Slf4j
@Api(value = "/apiExLog", description = "测试api日志&异常处理&接口数据校验 记录日志->DB")
public class ApiExLogTestController {

    @LogEvent(moduleName = "测试api模块",description = "测试参数校验")
    @PostMapping(value = "/testData")
    public Response testData(@Valid @RequestBody TestPostModelVo testPostModelVo, BindingResult bindingResult) throws Exception {
//        if(1==1)throw new Exception("asd");
        log.info(this.getClass()+"测试通过了啊");
//        Object o = dsmtPublicWechatDao.selectByPhone("123");
        return Response.succeed(this.getClass().getName()+"测试通过了啊");
    }
}
